﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="tags.aspx.vb" Inherits="Prototype.tags" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" 
        GroupItemCount="3">
        <AlternatingItemTemplate>
            <td runat="server" style="">
                <asp:HyperLink ID="Tag" runat="server"  Text='<%# Eval("Tag") %>' NavigateUrl='<%# Eval("Tag","~/tags.aspx?Tag={0}") %>'> </asp:HyperLink>
                            
                <br />
            </td>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <td runat="server" style="">
                <asp:TextBox ID="TagTextBox" runat="server" Text='<%# Bind("Tag") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                <br />
            </td>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" style="">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EmptyItemTemplate>
<td runat="server" />
        </EmptyItemTemplate>
        <GroupTemplate>
            <tr ID="itemPlaceholderContainer" runat="server">
                <td ID="itemPlaceholder" runat="server">
                </td>
            </tr>
        </GroupTemplate>
        <InsertItemTemplate>
            <td runat="server" style="">
                <asp:TextBox ID="TagTextBox" runat="server" Text='<%# Bind("Tag") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                <br />
            </td>
        </InsertItemTemplate>
        <ItemTemplate>
            <td runat="server" style="">
                <asp:HyperLink ID="Tag" runat="server"  Text='<%# Eval("Tag") %>' NavigateUrl='<%# Eval("Tag","~/tags.aspx?Tag={0}") %>'> </asp:HyperLink>
                
                <br />
            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table ID="groupPlaceholderContainer" runat="server" border="0" style="">
                            <tr ID="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" style="">
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <td runat="server" style="">
                  <asp:HyperLink ID="Tag" runat="server"  Text='<%# Eval("Tag") %>' NavigateUrl='<%# Eval("Tag","~/tags.aspx?Tag={0}") %>'> </asp:HyperLink>
              
                <br />
            </td>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:booksConn %>" 
        ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
        SelectCommand="SELECT [Tag], [ID] FROM [BookTag]"></asp:SqlDataSource>
    <br />
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataSourceID="SqlDataSource2">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="details.aspx?ID={0}" DataTextField="Bookname" 
                HeaderText="BookName" Text="BookName" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:booksConn %>" 
        ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
        
    SelectCommand="SELECT DISTINCT [ID], [Bookname], [Tag] FROM [booksTagView] WHERE ([Tag] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="Tag" QueryStringField="Tag" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
